From f339c908513e4c8e7923cc0366a6ceebcbcc3a16 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 14 Aug 2018 20:58:34 -0700 Subject: [PATCH] Have TitleParser::parseTitle() default to NS_MAIN to match Title Matches the default parameters of Title::newFromText(). Change-Id: Id08312d424be9ae7e64688bb21687204ae77c560 --- includes/title/MediaWikiTitleCodec.php | 2 +- includes/title/TitleParser.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/title/MediaWikiTitleCodec.php b/includes/title/MediaWikiTitleCodec.php index 890a870a2a..a00ef1e966 100644 --- a/includes/title/MediaWikiTitleCodec.php +++ b/includes/title/MediaWikiTitleCodec.php @@ -149,7 +149,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser { * @throws MalformedTitleException * @return TitleValue */ - public function parseTitle( $text, $defaultNamespace ) { + public function parseTitle( $text, $defaultNamespace = NS_MAIN ) { // NOTE: this is an ugly cludge that allows this class to share the // code for parsing with the old Title class. The parser code should // be refactored to avoid this. diff --git a/includes/title/TitleParser.php b/includes/title/TitleParser.php index de65be8529..ddffed6789 100644 --- a/includes/title/TitleParser.php +++ b/includes/title/TitleParser.php @@ -43,5 +43,5 @@ interface TitleParser { * @throws MalformedTitleException If the text is not a valid representation of a page title. * @return TitleValue */ - public function parseTitle( $text, $defaultNamespace ); + public function parseTitle( $text, $defaultNamespace = NS_MAIN ); } -- 2.20.1